#!/usr/bin/perl 

use strict;
# /org/lists.debian.org/msgid-search/lib
use lib '/org/lists.debian.org/msgid-search/lib';

use MessageID;

my $msg_id = new MessageID("/org/lists.debian.org/msgid-search/db/");

my $msgid = $ARGV[0];

$msgid =~ s#^<##;
$msgid =~ s#>$##;

my $results = $msg_id->search_msgid($msgid);

foreach my $result (@{$results}) {
#        print $result->{'resinfo'}."\n";
        print "http://lists.debian.org" . $result->{'reslink'}."\n";
#        print $result->{'edition'}."\n";
##       print $result->{'dbfile'}."\n";
#        print $result->{'list'}."\n";
}

__END__

gives:
perl t.pl
debian-announce 2005 #3
http://lists.debian.org/debian-announce/debian-announce-3/msg00003.html
2005
db/2005
debian-announce
